<!--
 * @Author: ShiJunJie
 * @Date: 2021-09-07 15:40:54
 * @LastEditors: ShiJunJie
 * @LastEditTime: 2021-09-08 14:44:30
 * @Descripttion: 
-->
<template>
  <div>
    <h1>登录界面</h1>
    <button @click="login">登录</button>
  </div>
</template>

<script setup>
  import storage from 'good-storage'
  import { ref } from 'vue'
  import { useRouter } from 'vue-router'
  import { USER } from '/@/api/User.js'

  const router = useRouter()

  if (storage.get('USER_TOKEN')) {
    router.push('/')
  }

  const login = () => {
    USER.login()
    router.push('/')
  }
</script>

<style lang="scss" scoped></style>
